@isTest
private class MeasureCalcControllerTest {
    static testMethod void testMethod1() {
       /* Cache__c c = new Cache__c(DeveloperName__c = 'ExcelDataCache');
        insert c ;  */
              // 客户
       Account acc = TestUtils.createAccount();
        // acc.Province__c = pro.Id;
        // acc.City__c = c.Id;
        // acc.District__c = d.Id;
       acc.Level__c = '一级医院';
        insert acc;

        // 业务机会
        Opportunity opp = TestUtils.createOpportunity();
        opp.AccountId = acc.Id;
        // opp.StageCanChange__c = '意向';
        // opp.StageName = '意向';
        opp.CooperationMode__c = '整体配送';
        insert opp;

        // 产品
        Id prt = Utils.getRecordTypeIdByDevNameAndObjName('NCProduct', 'Product__c');
        Product__c p = TestUtils.createProduct();
        p.RecordTypeId = prt;
        insert p;

        Product__c p1 = TestUtils.createInst();
        p1.RecordTypeId = prt;
        insert p1;
        // Product__c p2 = TestUtils.createInst();
        // insert p2;

        // 价格
        Price__c price = TestUtils.createPrice();
        price.Product__c = p.Id;

        insert price;

        
        // 测算
         Measure_Calculate__c mc1 = new Measure_Calculate__c(
            
            Opportunity__c = opp.Id
        );
         insert mc1;

        Measure_Calculate__c mc = new Measure_Calculate__c(
            
            Opportunity__c = opp.Id,
            LastMeasureCalc__c = mc1.Id
        );
        insert mc;

        // 测算产品
        Measure_Calculate_Product__c mcp = new Measure_Calculate_Product__c(
            Measure_Calculate__c = mc.Id,
            Product__c = p.Id
        );
        insert mcp;
         Measure_Calculate_Product__c mcp1 = new Measure_Calculate_Product__c(
            Measure_Calculate__c = mc.Id,
            Product__c = p1.Id
        );
        insert mcp1;


        AdditionalService__c ads=  new AdditionalService__c();
        ads.Cost__c = 1;
        ads.Name = '11';
        ads.MeasureCalc__c = mc.Id;
        insert ads ;
    
        System.Test.startTest();


        PageReference page1 = new PageReference('/apex/MeasureCalcResultStandard?id=' + mc.Id);
        System.Test.setCurrentPage(page1);
        MeasureCalcStandardController qcs= new MeasureCalcStandardController();
        qcs.init();
        qcs.getDetails();

        // qc.saveAndGoPre();
        // qc.saveAndGoSearch();
        // qc.saveAndGoInput();
       /* qc.saveAndGoCompany();
        qc.saveAndGoGroup();
        qc.jumpToDealerManage();
        qc.jumpToCompanyManage();
        qc.jumpToGroupManage();

        qc.calc = 'delear';
        System.debug('<===>'+qc.urlStr);
        qc.init();

        

        qc.init();
        qc.justSave();
        qc.urlStr = 'company';
        qc.calc = 'company';
        qc.init();
        qc.calc = 'managecompany';
        qc.urlStr = 'managecompany';
        qc.init();
        qc.justSave();

        qc.urlStr = 'group';
        qc.calc = 'group';
        qc.init();
        qc.urlStr = 'managegroup';

        qc.calc = 'managegroup';
        qc.init();
        qc.saveAndStay();*/


    }
}